﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;

namespace LynxWebLog
{
  public static class XmlDocumentExtensions
  {
    public static XmlNode AddChild(this XmlNode node, string name)
    {
      XmlElement newElement = null;
      if (node.OwnerDocument == null)
        newElement = ((XmlDocument)node).CreateElement(name);
      else
        newElement = node.OwnerDocument.CreateElement(name);

      return node.AppendChild(newElement);
    }
  }
}